<%@ page language="java" import="java.util.*,com.king.cms.common.*" pageEncoding="utf-8"%>
<%@ include file="/hotel/include/css.jsp"%><%-- /*包含css样式表*/ --%>

<%@ include file="date.jsp"%><%-- /*包含css样式表*/ --%>
  
 
<%
 	String action = (String)request.getAttribute("action");
    Map map = (Map)request.getAttribute("dataMap"); 
     
    if(null == map)
       map = new HashMap();
    String templateStr = (String)request.getAttribute("template");
    String[] clientStr = (String[])request.getAttribute("clientStr");
    String nameStr = (String)request.getAttribute("nameStr");
    String idStr = (String)request.getAttribute("idStr");
    String contentStr = (String)request.getAttribute("contentStr");
    String type = (String)request.getAttribute("type");
     String place = (String)request.getAttribute("placeselect");
    String userStr = (String)request.getAttribute("userStr");
    String areaStr = (String)request.getAttribute("areaStr");
    String inputsize = (String)request.getAttribute("inputsize");
    int size = Integer.parseInt(inputsize);
    int pow=(PowerParameter.save | PowerParameter.cls | PowerParameter.list|PowerParameter.inquiry);
    String isrefresh = (String)request.getAttribute("isrefresh");
    String isconfig = (String)request.getAttribute("isconfig");
    //request.setCharacterEncoding("UTF-8");
    
%>
<html xmlns:MSIE='http://www.microsoft.com/ie'>
<head>
<title> </title>
 <style>   
    
  @media   all   
  {   
  MSIE\:CLIENTCAPS{behavior:url(#default#clientcaps)}   
  }   
  </style>  
<meta  http-equiv="Expires"     CONTENT="0">           
<meta  http-equiv="Cache-Control"     CONTENT="no-cache">           
<meta  http-equiv="Pragma"     CONTENT="no-cache"> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   
<script language="JavaScript" src="<%=path%>/js/generalcheck.js"></script> 
<script language="javascript">
var width = 768;
var height = 1024;
 function changetype(){
     form1.action="<%=path%>/pubinfo.do?action=add&type="+form1.hytzTag.value;
    
     form1.submit();
 }
 function ki_inquiry(){
			    openwindow("<%=path%>/pubinfo.do?action=search",'800','600','');
			}
 function refresh(){
    
       var size = form1.fieldflag.value;
       var isize = parseInt(size);
       var size2 = isize+isize;
       var obj = document.getElementById('line1_remark');
       var str = '<br>（汉字'+size+'以内，英文'+size2+'以内）'; 
       obj.innerHTML = str;
       var obj1 = document.getElementById('line2_remark'); 
       obj1.innerHTML = str;
       var obj2 = document.getElementById('line3_remark');
       obj2.innerHTML = str;
       var obj3 = document.getElementById('line4_remark');
       obj3.innerHTML = str;
       
 }
 function selectRoom(){
 	var str =  form1.placeselect.value;
 	if(''!= str){
 	  var index = str.indexOf('#');
 	  var areaId = str.substring(0,index);
 	  var type = str.substring(index+1); 
 	  if(0 == type)
 	    openwindow('<%=path%>/client.do?action=select&type=<%=type%>&area='+areaId+'&meetingId=<%=map.get("ID")%>','1024','768','_blank');
 	  if(1==type){
 	     var vv = document.getElementById(str).value;
 	     var inx = vv.indexOf('#'); 
 	     form1.fieldflag.value=document.getElementById(str+'size').value;;
         form1.hytzPort.value=vv.substring(0,inx)+',';
         form1.content.value="null#";
         form1.hytzPortName.value=vv.substring(inx+1)+',';
 	  }
 	   
 	}
   
         
 }
  function gotopage(){ 　
      if(checkData()){
          var regS = new RegExp("&","gi");
          var filePath = form1.filePath.value; 
          var line1 = form1.hytzLine1.value; 
          var line2 = form1.hytzLine2.value;
          var line3 = form1.hytzLine3.value;
          var line4 = form1.hytzLine4.value;
           
          line1 = line1.replace(regS,'@');
          line2 = line2.replace(regS,'@');
          line3 = line3.replace(regS,'@');
          line4 = line4.replace(regS,'@');
          var idStr = form1.hytzPort.value;
          var index = idStr.indexOf(',');
          var lcdId = '';
          if(index != -1)
             lcdId = idStr.substring(0,index);
          var index;
          var position = filePath.lastIndexOf("/");
          if(filePath.lastIndexOf("/") != -1)
                 index = position+1;
          var fileName = filePath.substring(index);
           
      	    openwindow1(encodeURI("<%=path%>/preview.do?meetingId=<%=map.get("ID")%>&lcdId="+lcdId+"&type=<%=type%>&hytzJssj="+form1.hytzJssj.value+"&hytzKssj="+form1.hytzKssj.value+"&filePath="+fileName+"&hytzLine1="+line1+"&hytzLine2="+line2+"&hytzLine3="+line3+"&hytzLine4="+line4+"&width="+width+"&height="+height),'','','');
      	 
       }
 }
 function saveData(){ 
      if(checkData()){
      	 form1.action="<%=path%>/pubinfo.do?action=save&type=<%=type%>";
      	 form1.submit();
       }
 }
 function checkData(){ 
      if(!validateNotNull(document.getElementById("hymc"),'会议名称'))
	     return false;
     //if(!validateNotNull(document.getElementById("template"),'发布模版')){
    	//return false;
    	//}
     if(!validateNotNull(document.getElementById("hytzZbdwz"),'主办单位中文名称'))
    	return false;
     if(!validateNotNull(document.getElementById("hytzZbdwe"),'主办单位英文名称'))
    	return false;
    // if(validateNotNull(document.getElementById("hytzHymcz"),'大屏幕第一行内容'))
    //	return false;
    // if(validateNotNull(document.getElementById("hytzHymce"),'大屏幕第二行内容'))
    //	return false;
    if(!validateNotNull(document.getElementById("hytzPort"),'会议地点'))
     	return false;
    // if(!validateNotNull(document.getElementById("hytzScwjlj"),'会议logo'))
    //	return false;
    	 
    /*if(form1.fieldflag.value == 40 || form1.fieldflag.value == 15){
         
	     if(!validateNotNull(document.getElementById("hytzLine1"),'小屏幕第一行内容'))
	       return false;
	     if(!validateNotNull(document.getElementById("hytzLine2"),'小屏幕第二行内容'))
	    	return false;
	     if(!validateNotNull(document.getElementById("hytzLine3"),'小屏幕第三行内容'))
	    	return false;
	     if(!validateNotNull(document.getElementById("hytzLine4"),'小屏幕第四行内容'))
	    	return false;
	    	 
	     
    }*/
     
    if(!validateNotNull(document.getElementById("hytzKssj"),'会议开始时间'))
    	return false;
    if(!validateNotNull(document.getElementById("hytzJssj"),'会议结束时间'))
    	return false;
   // if(!validateNotNull(document.getElementById("publishId"),'发布人'))
   // 	return false;
    //if(!validateNotNull(document.getElementById("hytzFbsj"),'发布时间'))
    //	return false;
     if(document.getElementById("hytzKssj").value >= document.getElementById("hytzJssj").value){
       alert("会议结束时间不能早于或等于开始时间");
       return false;
    } 
   
    return true;
 }
 function ki_save(){ 
	 saveData();
	}
	function ki_cls(){
		 document.getElementById("hymc").value='';
		 document.getElementById("hytzZbdwz").value='';
		 document.getElementById("hytzZbdwe").value='';
		 document.getElementById("hytzPort").value='';
		 document.getElementById("hytzScwjlj").value='';
		 document.getElementById("hytzLine1").value='';
		 document.getElementById("hytzLine2").value='';
		 document.getElementById("hytzLine3").value='';
		 document.getElementById("hytzLine4").value='';
		 document.getElementById("hytzKssj").value='';
		 document.getElementById("hytzJssj").value='';
		 
		 
	}
	function ki_list(){
		window.open('<%=basePath%>info.do?action=list','_self');
	}
	

 function uploadfile(){
   openwindow('<%=path%>/hotel/info/upload.jsp?type=<%=type%>&fileId=<%=map.get("UPLOAD_FILE_ID")%>','500','300','_blank');
 }
 /*取得字符串的字节长度*/
function strlen(str)
	{ var i;
	  var len;
	 len=0;
	for(i=0;i<str.length;i++)
	{
	if(str.charCodeAt(i)>255)
	  len+=2;
	  else
	  len++;
	}
	return len;
}   
function docheck(obj){
  var length = strlen(obj.value);
  var l = form1.fieldflag.value; 
  if(l == '') 
     l = '15'; 
  var ss = parseInt(l);
  var sss = ss*2; 
  if(length > sss){
     alert("只能输入"+ss+"个汉字或"+sss+"个字符");
     obj.focus();
     return false;
  } 
   
  return true;
} 
function delfile(id){
   if(id == null||id == 'null'){
     form1.hytzScwjlj.value='';
     form1.hytzScwjljId.value='';
     form1.filePath.value=''; 
   }else{
    form1.action="<%=basePath%>pubinfo.do?action=delfile&meetingId="+id;
    form1.submit();
   }

}
function displayConfig(){
   openwindow('<%=path%>/display.do?action=view&meetingId=<%=map.get("ID")%>','700','500','');
}
</script> 
<style type="text/css">
<!--
.STYLE2 {color: #FF0000}
-->
</style>
</head>

<body background="<%=imgpath%>top3.gif" leftmargin="0" topmargin="0">
<MSIE:CLIENTCAPS   ID='idClient'/>  
<script   language='javascript'>   
    
  <!--   
  width = idClient.availWidth;
  height =  idClient.availheight;    
    
  -->   
    
  </script>   
<br>
<form name="form1"    action=""   method="post"> 

	<center>	   
	<table  border="0" cellpadding="2" cellspacing="1" class="bg_table" style="width:80%" bordercolor="#111111">
	   <tr class="top_td"> 
		<td colspan="4"></td>
		<input type="hidden" name="fieldflag" value="<%=inputsize %>">
	   </tr>
	   
  <tr class="td2">
    <td width="25%">当前发布类型</td>
    <td width="30%">
    <input type="hidden" name="hytzTag" value="<%=map.get("MEETING_PUBLISH_TYPE")==null?type:map.get("MEETING_PUBLISH_TYPE") %>">
    <%if(null == map.get("MEETING_PUBLISH_TYPE")){  
       
       out.print(StringUtil.returnInfoName1(type));
       }else{ 
          out.print(StringUtil.returnInfoName1(map.get("MEETING_PUBLISH_TYPE")+"")); 
       } %>
      	</td>
    <td width="20%">是否刷新</td>
    <td width="30%"><select name="isrefresh" style="width:90%;">
                      <option value=0 <%if("0".equals(isrefresh)){out.println(" selected");} %>>否</option>
                      <option value=1 <%if("1".equals(isrefresh)){out.println(" selected");} %>>是</option>
                      </select></td>
  </tr>

  <tr class="td2"   >
    <td width="20%">主办单位(中文)</td>
    <td width="30%"><label>
      <input type="text" name="hytzZbdwz" class="area100" check="c_y_200" style="width:90%" value="<%=StringUtil.NULL2Blank(map.get("MEETING_UNIT_CN")+"") %>"  >
    </label></td>
    <td width="20%">主办单位(英文)</td>
    <td width="30%"><label>
      <input type="text" name="hytzZbdwe"  class="area100" check="c_y_200" style="width:90%" value="<%=StringUtil.NULL2Blank(map.get("MEETING_UNIT_EN")+"") %>" >
    </label></td>
  </tr>
 <tr class="td2" >
    <td>会议主题</td>
    <td colspan="3" ><input type="hidden" name="meetingId"  class="area100" check="c_y_200" maxlength="30" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("ID")+"") %>" ><input type="text" name="hymc"  class="area100" check="c_y_200" maxlength="30" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("MEETING_NAME")+"") %>" >
       
       </td>
    </tr>
  <!--  <tr class="td2" id="meet"  >
    <td>大屏第一行显示<span class="STYLE2"><br>（汉字15以内，英文30以内）</span></td>
    <td colspan="3" ><input type="text" name="hytzHymcz"  class="area100" check="c_y_200" maxlength="30" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("BIGSCREEN_LINE_ONE")+"") %>" ></td>
    </tr>
  <tr class="td2" id="meet1"  >
    <td>大屏第二行显示<span class="STYLE2"><br>（汉字15以内，英文30以内）</span></td>
    <td colspan="3" ><input type="text" name="hytzHymce"  class="area100" check="c_y_200" maxlength="30" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("BIGSCREEN_LINE_TWO")+"") %>" ></td>
    </tr>-->
     <tr class="td2" id="meet1"  >
     <td>选择会议地点 </td>
    <td colspan="3" >
    <input type="hidden" name="hytzPort"  class="area100"    value="<%=StringUtil.NULL2Blank(idStr) %>" >
    <input type="hidden" name="content"  class="area100"     value="<%=StringUtil.NULL2Blank(contentStr) %>" >
    <input type="text" name="hytzPortName"   class="area100"  style="width:70%" value="<%=StringUtil.NULL2Blank(nameStr) %>" readonly>
     <%=areaStr%></td>
    </tr>
   
 <!-- <tr class="td2"  id="east" style="display:''">
    <td>东侧屏幕组合</td>
    <td><label>
      <input type="checkbox" name="hytzPort4"  value = "1"  >
      同时显示
    </label></td>
    <td></td>
    <td></td>
  </tr>
  <tr class="td2"  id="west" style="display:''">
    <td>西侧屏幕组合</td>
    <td><label>
      <input type="checkbox" name="hytzPort5"  value = "1"   >
      同时显示
    </label></td>
    <td></td>
    <td></td>
  </tr> -->
  <tr class="td2">
    <td  width="20%">选择上传LOGO</td>
    
    <td colspan="2"  width="70%"><input type="text" name="hytzScwjlj"  class="area100"   style="width:94%" value="<%=StringUtil.NULL2Blank(map.get("FILE_NAME")+"") %>"  readonly>
    <input type="hidden" name="hytzScwjljId"  class="area100"   value="<%=StringUtil.NULL2Blank(map.get("UPLOAD_FILE_ID")+"") %>" >
    <input type="hidden" name="filePath"  class="area100"   value="<%=StringUtil.NULL2Blank(map.get("FILE_PATH")+"") %>" ></td>
     <td width="10%"><label>
      <input type="button" name="choiceupload" class="area100" value="选择"   onClick="uploadfile()"> &nbsp;
      <input type="button"   class="area100" value="删除"   onClick="delfile('<%=map.get("ID")%>')"> 
    </label></td>
  </tr>

  <tr class="td2" id="line1"  >
    <td>小屏第一行显示<span class="STYLE2" id="line1_remark"><br>（汉字<%=size %>以内，英文<%=size*2 %>以内）</span></td>
    <td colspan="3"><input type="text" name="hytzLine1"   class="area100" onblur="return docheck(this)"  check="c_y_200" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("SMALLSCREEN_LINE_ONE")+"") %>" >	</td>
  </tr>
  <tr class="td2" id="line2"  >
    <td>小屏第二行显示<span class="STYLE2" id="line2_remark"><br>（汉字<%=size %>以内，英文<%=size*2 %>以内）</span></td>
    <td colspan="3"><input type="text" name="hytzLine2"   class="area100"  onblur="return docheck(this)"  check="c_y_200" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("SMALLSCREEN_LINE_TWO")+"") %>" >	</td>
  </tr>
  <tr class="td2" id="line3"  >
    <td>小屏第三行显示<span class="STYLE2" id="line3_remark"><br>（汉字<%=size %>以内，英文<%=size*2 %>以内）</span></td>
    <td colspan="3"><input type="text" name="hytzLine3"   class="area100" onblur="return docheck(this)"   check="c_y_200" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("SMALLSCREEN_LINE_THREE")+"") %>" >	</td>
  </tr>
  <tr class="td2" id="line4"  >
    <td>小屏第四行显示<span class="STYLE2" id="line4_remark"><br>（汉字<%=size %>以内，英文<%=size*2 %>以内）</span></td>
    <td colspan="3"><input type="text" name="hytzLine4"  class="area100"  onblur="return docheck(this)"  check="c_y_200" style="width:96%" value="<%=StringUtil.NULL2Blank(map.get("SMALLSCREEN_LINE_FOUR")+"") %>" >	</td>
  </tr> 
  <tr class="td2">
    <td   >会议起始时间</td>
    <td><input type="hidden" name="currentBegTime" value="<%=StringUtil.dateTimeSubStr(map.get("MEETING_BEGIN_TIME")+"") %>">
    <input type="text" name="hytzKssj" class="area100" check="c_n_200" style="width:90%" value="<%=StringUtil.dateTimeSubStr(map.get("MEETING_BEGIN_TIME")+"") %>"  onClick="changediv(this);changeshow2Sj(this);" readonly></td>
    <td  >会议结束时间</td>
     
    <td><input type="hidden" name="currentEndTime" value="<%=StringUtil.dateTimeSubStr(map.get("MEETING_END_TIME")+"") %>"><input type="text" name="hytzJssj" class="area100" check="c_n_200" style="width:90%" value="<%=StringUtil.dateTimeSubStr(map.get("MEETING_END_TIME")+"") %>"    onClick="changediv(this);changeshow2Sj(this);" readonly></td>
  </tr>
  <tr class="td2">
    <td>发布者</td>
    <td> <input type="hidden" name="publishId" value="<%if(null == map.get("MEETING_PUBLISH_ID")||"null".equals(map.get("MEETING_PUBLISH_ID")+"")){out.print(SessionUtil.getUserId(request));} else{ out.print(StringUtil.NULL2Blank(map.get("MEETING_PUBLISH_ID")+""));}%>"><%if(null == map.get("MEETING_PUBLISH_ID")||"null".equals(map.get("MEETING_PUBLISH_ID")+"")){out.print(SessionUtil.getUserName(request));}else{ out.print(InitSystem.getUserNameById(map.get("MEETING_PUBLISH_ID")+""));}%></td>
    <td>发布时间</td>
    <td><input type="text" name="hytzFbsj"  class="area100" check="c_n_200" style="width:90%" value="<%=StringUtil.currentTime()%>"   readonly></td>
  </tr>

  <tr class="td2" id="preview" style="display:" >
    <td colspan="4"><%if(map.get("ID") != null&&null!= isconfig){ %><input type="button" name="dook" value="设置" onClick="javascript:displayConfig()" class="area100"  ><%} %>&nbsp;<input type="button" name="dook" value="预览" onClick="javascript:gotopage()" class="area100"  ></td>
  </tr>
		  <tr class="top_td" >
			<td  colspan="4">			</td>
		  </tr>
     </table>
  </center>
</form> 

</body>
</html>
<%@ include file="/hotel/pow.jsp"%>
